import Cookies from "js-cookie"

const TokenKey = "access_token"
const RefreshToken = "refresh_token"
const ExpiresIn = "expires_in"
const UserInfo = "UserInfo"

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(value) {
  return Cookies.set(TokenKey, value)
}

export function getUserInfo() {
  return Cookies.get(UserInfo)
}

export function setUserInfo(value) {
  return Cookies.set(UserInfo, value)
}

export function getRefreshToken() {
  return Cookies.get(RefreshToken)
}

export function setRefreshTtoken(value) {
  return Cookies.set(RefreshToken, value)
}

export function getExpiresIn() {
  return Cookies.get(ExpiresIn)
}

export function setExpiresIn(value) {
  return Cookies.set(ExpiresIn, value)
}

export function removeUserInfo() {
  return Cookies.remove(UserInfo)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function removeRefreshToken() {
  return Cookies.remove(RefreshToken)
}

export function removeExpiresIn() {
  return Cookies.remove(ExpiresIn)
}
